import Vue from 'vue'
import vueRouter from 'vue-router'

import Play from '@/view/Play'
import Home from '@/view/Home'
import Layout from '@/view/Layout'
import Search from '@/view/Search'
Vue.use(vueRouter)
const routes = [
    {
        path: '/',
        redirect: '/layout',
    },
    {
        path: '/layout',
        component: Layout,
        redirect: '/layout/home',
        children: [
            {
                path: 'home',
                component: Home,
                meta: {
                    title:'首页'
                }
            },
            {
                path: 'search',
                component: Search,
                meta:{
                    title:'搜索'
                }
            }
        ]
    },
    {
        path: '/play',
        component: Play
    }
]

const router = new vueRouter({
    routes
})
export default router